package com.eling.elcms.travel.model;

import com.eling.elcms.core.dao.annotation.In;
import com.eling.elcms.core.model.BaseModel;
import org.hibernate.search.annotations.DocumentId;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.IndexedEmbedded;

import javax.persistence.*;

/**
 * 退房结算详细（子表）
 * 
 * @author zhoulin
 *
 */
@Entity
@Indexed
@Table(name = "travel_checkoutsetldetail")
public class CheckOutSetlDetail extends BaseModel {

	private static final long serialVersionUID = 1460695140857629029L;

	@Id
	@In
	@DocumentId
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long pkCheckOutSetlDetail;

	/** 退房结算主表 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "pkCheckOutDeal")
	@IndexedEmbedded(depth = 1)
	private CheckOutDeal checkOutDeal;

	/** 人员详细 */
	@OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.MERGE)
	@JoinColumn(name = "pkRoomPersonalInfo")
	@IndexedEmbedded(depth = 1)
	private RoomPersonalInfo roomPersonalInfo;
	
	@Version
	private Integer version;

	public Long getPkCheckOutSetlDetail() {
		return pkCheckOutSetlDetail;
	}

	public void setPkCheckOutSetlDetail(Long pkCheckOutSetlDetail) {
		this.pkCheckOutSetlDetail = pkCheckOutSetlDetail;
	}

	public CheckOutDeal getCheckOutDeal() {
		return checkOutDeal;
	}

	public void setCheckOutDeal(CheckOutDeal checkOutDeal) {
		this.checkOutDeal = checkOutDeal;
	}

	public RoomPersonalInfo getRoomPersonalInfo() {
		return roomPersonalInfo;
	}

	public void setRoomPersonalInfo(RoomPersonalInfo roomPersonalInfo) {
		this.roomPersonalInfo = roomPersonalInfo;
	}

	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

}
